from utils.compat import es

def send_event(name, data):
    """
    Send an event
    @param name: The name of the event
    @param data: The event variables data to send (must be dictionary)
    """
    es.event('initialize', name)
    for key, value in data.iteritems():
        es.event('setstring', name, key, value)
    es.event('fire', name)